/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.tukano.swingdeco.text;

import java.io.IOException;
import java.net.URL;
import javax.swing.JEditorPane;
import javax.swing.JScrollPane;

/**
 *
 * @author utente4
 */
public class JEditorPaneExt extends JEditorPane {
    
    //Default serial version code
    private static final long serialVersionUID = 0;
    
    public static JEditorPaneExt newInstance(URL page) {
        try {
            return new JEditorPaneExt(page);
        } catch(Exception ex) {
            ex.printStackTrace();
            return new JEditorPaneExt();
        }
    }
    
    private JScrollPane scroller;
    
    public JEditorPaneExt() {
        super();
    }
    
    public JEditorPaneExt(URL page) throws IOException {
        super(page);
    }
    
    public JEditorPaneExt setNotEditable() {
        setEditable(false);
        return this;
    }
    
    public JScrollPane getScroller() {
        return scroller == null ? scroller = new JScrollPane(this) : scroller;
    }
}
